<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class GoodsPostRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'=>'required',
            'price'=>'required',
            'content'=>'required',

        ];
    }

    /**
     * 自定义验证规则的错误信息
     *
     * @return array
     */
    public function messages()
    {
        return [
            'title.required'=>'商品标题不能为空',
            'price.required'=>'商品价格不能为空',
            'content.required'=>'商品介绍不能为空',
        ];
    }
}
